﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NXB_ThemSach.aspx.cs" Inherits="BookStore.NXB_ThemSach"
    MasterPageFile="~/One-Column.master" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="BreadcrumbsContent">
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="MainColumnContent">
    <div class="col-1-addbook">
        <ul class="form-list addbook">
            <li>
                <asp:Table ID="addbookTable" runat="server">
                    <asp:TableHeaderRow>
                        <asp:TableCell CssClass="registry-title" ColumnSpan="2">
                            <asp:Label ID="LbWelcome" runat="server" Text="Chào mừng Nhà Xuất Bản: "></asp:Label>
                            <asp:Label ID="LbNhaXuatBan" runat="server"></asp:Label>
                        </asp:TableCell>
                    </asp:TableHeaderRow>
                    <asp:TableRow>
                        <asp:TableCell ColumnSpan="3"></asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="LoaiSachLabel" runat="server" AssociatedControlID="DropDownLoaiSach">Loại sách:</asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:DropDownList ID="DropDownLoaiSach" runat="server" DataSourceID="DropdownDS"
                                DataTextField="TenLoaiSach" DataValueField="MaLoaiSach">
                            </asp:DropDownList>
                            <asp:SqlDataSource ID="DropdownDS" runat="server" ConnectionString="<%$ ConnectionStrings:BookStoreConnectionString %>"
                                SelectCommand="SELECT LoaiSach.MaLoaiSach, LoaiSach.TenLoaiSach FROM LoaiSach INNER JOIN NhaXuatBan_LoaiSach ON LoaiSach.MaLoaiSach = NhaXuatBan_LoaiSach.MaLoaiSach WHERE (NhaXuatBan_LoaiSach.MaNXB = @maNXB)">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="-1" Name="maNXB" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="TenSachLabel" runat="server" AssociatedControlID="DropDownTenSach">Tên sách:</asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:DropDownList CssClass="validate-select" ID="DropDownTenSach" runat="server"
                                DataSourceID="dtSach" DataTextField="TenSach" DataValueField="MaSach">
                            </asp:DropDownList>
                            <asp:SqlDataSource ID="dtSach" runat="server" ConnectionString="<%$ ConnectionStrings:BookStoreConnectionString %>"
                                SelectCommand="SELECT * FROM [Sach] WHERE ([MaLoaiSach] = @MaLoaiSach)">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="-1" Name="MaLoaiSach" Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:Button CssClass="btRefresh" ID="btRefresh" runat="server" Text="Refresh" OnClick="btRefresh_Click" />
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="SoLuongHienCoLabel" runat="server" AssociatedControlID="txtSoLuongHienCo">Số lượng hiện có:</asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:TextBox ID="txtSoLuongHienCo" runat="server" CssClass="input-text" ReadOnly="True"
                                BackColor="#EEEEEE"></asp:TextBox>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:Button CssClass="btRefresh" ID="btSLRefresh" runat="server" OnClick="btSLRefresh_Click"
                                Text="Refresh" />
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="SoLuongLabel" runat="server" AssociatedControlID="txtSoLuong">Số sách nhập thêm:</asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:TextBox CssClass="input-text" ID="txtSoLuong" runat="server"></asp:TextBox>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell Height="30px" ColumnSpan="3" Style="vertical-align: middle;">
                            <hr style="border: 1px solid #EEEEEE;" />
                        </asp:TableCell>
                    </asp:TableRow>

                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="FromLabel" runat="server" AssociatedControlID="From">Địa chỉ chuyển hàng đi:</asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:TextBox CssClass="input-text" ID="From" runat="server"></asp:TextBox>
                        </asp:TableCell>
                    </asp:TableRow>

                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="TranServiceLabel" runat="server" AssociatedControlID="ddlTranService">Dịch vụ vận chuyển:</asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:DropDownList ID="ddlTranService" runat="server">
                                <asp:ListItem Value="VC15">VC15</asp:ListItem>
                                <asp:ListItem Value="VC07">VC07</asp:ListItem>
                                <asp:ListItem Value="VC11">VC11</asp:ListItem>
                                <asp:ListItem Value="VC13">VC13</asp:ListItem>
                            </asp:DropDownList>
                        </asp:TableCell>
                    </asp:TableRow>

                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="TinhThanhLabel" runat="server" AssociatedControlID="ddlTinhThanh">Tỉnh/Thành phổ:</asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:DropDownList ID="ddlTinhThanh" runat="server" >
                            </asp:DropDownList>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:Button OnClick="btProvRefresh_Click" ID="btProvRefresh" CssClass="btRefresh" runat="server" Text="Refresh" />
                        </asp:TableCell>
                    </asp:TableRow>

                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Button CssClass="button" ID="btCapNhat"
                                runat="server" Text="Cập Nhật" OnClick="btCapNhat_Click" />
                        </asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
            </li>
        </ul>
        Nhấn Refresh để lấy danh sách, số Lượng Sách và danh sách tỉnh thành từ nhà Vận Chuyển
    </div>
    <div class="col-2-addbook">
        <asp:Label ID="lbRes" runat="server" Style="font-size:14px;font-weight: bold;"></asp:Label>
        <br />
        <br />
        <asp:Label ID="lblTransportKey" runat="server" Text=""></asp:Label>
        <br />
        <asp:Label ID="lblTransportQuantity" runat="server" Text=""></asp:Label>
        <br />
        <asp:Label ID="lblTransportService" runat="server" Text=""></asp:Label>
        <br />
        <asp:Label ID="lblPrice" runat="server" Text=""></asp:Label>
    </div>
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="HeadContent">
    <title>Thêm Sách</title>
</asp:Content>
